<admintpl file="header" />
</head>
<body>
	<div><br><br>
		<form class="form-horizontal js-ajax-form" action="{:url('Admin/Goods/add_price')}" method="post">
			<fieldset>
            	<notempty name='result'>
                <foreach name="result" item="vo">
                    <div class="control-group">
                        <label class="control-label">{$vo.grade_name}价格</label>
                        <div class="controls">
                            <input type="hidden" name="member_price_id[]" value="{$vo.member_price_id}">
                            <input type="hidden" name="ability_id[]" value="{$vo.ability_id}">
                            <input type="hidden" name="member_grade[]" value="{$vo.member_grade}">
                            <input type="text" name="price[]" value="{$vo.price}">
                            <span class="form-required">*</span>
                        </div>
                    </div>
                 </foreach>
                <div class="form-actions">
            		 <div class="btn btn-primary" id="save_vip">保存</div>
                      <a class="btn" id="js-dialog-close">关闭</a>
                </div>                 
                 </notempty>
                 <empty name="result">
                    <foreach name="grade" item="vo">
                        <div class="control-group">
                            <label class="control-label">{$vo.grade_name}价格</label>
                            <div class="controls">
                                <input type="hidden" name="member_grade" value="{$vo.member_grade_id}">
                                <input type="text" name="price" value="">
                                <span class="form-required">*</span>
                            </div>
                        </div>
                    </foreach>
                 	<div class="form-actions">
            			<div class="btn btn-primary" id="check-btn">保存</div>
						<a class="btn" id="js-dialog-close">关闭</a>
					</div>
                  </empty>
			</fieldset>
		</form>
	</div>
	<script type="text/javascript" src="__STATIC__/js/admin.js?v={:time()}"></script>
    
	<script type="text/javascript">
	 // 提交订单
	$("#check-btn").click(function(){
		var key="{$num}";
		var a=$("form").serialize();
		sessionStorage.setItem(key, JSON.parse(JSON.stringify(a)));
		$('#js-dialog-close').click();
	});
	$("#save_vip").click(function(){
		$.post($("form").attr("action"), $("form").serialize(), function(result){
			$('#js-dialog-close').click();
			})
		})
    </script>
</body>
</html>